﻿namespace HRM.CORE.Process
{
    using DevExpress.Data;
    using DevExpress.Utils;
    using DevExpress.XtraBars;
    using DevExpress.XtraEditors;
    using DevExpress.XtraEditors.Controls;
    using DevExpress.XtraEditors.Repository;
    using DevExpress.XtraGrid;
    using DevExpress.XtraGrid.Columns;
    using DevExpress.XtraGrid.Menu;
    using DevExpress.XtraGrid.Views.BandedGrid;
    using DevExpress.XtraGrid.Views.Base;
    using DevExpress.XtraGrid.Views.Grid;
    using DevExpress.XtraGrid.Views.Grid.ViewInfo;
    using Microsoft.VisualBasic;
    using APP.HELPER;
    using Common.Class; using APP.HELPER.Utils.Language; using Security.Security; using Dictionary.ERP;
    using Common.Report;
    using HRM.CORE;
    using HRM.CORE.REPORT;
    using System; using Extra.ERP;
    using System.ComponentModel;
    using System.Drawing;
    using System.Runtime.CompilerServices;
    using System.Windows.Forms; using Common;
    using Common;
    using Extra.ERP;
    using Security.ERP;

    public class xucListPetition : Common.xucBase
    {
        private Bar bar1;
        private BarDockControl barDockControlBottom;
        private BarDockControl barDockControlLeft;
        private BarDockControl barDockControlRight;
        private BarDockControl barDockControlTop;
        private BarManager barManager1;
        private BarEditItem bbeBeginDate;
        private BarEditItem bbeEndDate;
        private BarButtonItem bbiAddEmployee;
        private BarButtonItem bbiClose;
        private BarButtonItem bbiDelete;
        private BarButtonItem bbiEdit;
        private BarButtonItem bbiExport;
        private BarEditItem bbiFilter;
        private BarButtonItem bbiPrint;
        private BarButtonItem bbiRefresh;
        private BandedGridColumn colBranchName;
        private BandedGridColumn colDepartmentName;
        private BandedGridColumn colDescription;
        private BandedGridColumn colEmployeeCode;
        private BandedGridColumn colFirstName;
        private BandedGridColumn colGroupName;
        private BandedGridColumn colLastName;
        private BandedGridColumn colPetitionID;
        private BandedGridColumn colReason;
        private BandedGridColumn colReasonCannot;
        private BandedGridColumn colRestFromDate;
        private BandedGridColumn colRestToDate;
        private BandedGridColumn colStatus;
        private BandedGridColumn colSymbol;
        private BandedGridColumn colWriteDate;
        private BandedGridColumn colWriteFromDate;
        private BandedGridColumn colWriteToDate;
        private IContainer components = null;
        private BandedGridView gbList;
        private GridControl gcList;
        private GridBand gridBand1;
        private GridBand gridBand2;
        private GridBand gridBand3;
        private GridBand gridBand5;
        private GridBand gridBand7;
        private GridBand gridBand8;
        private GridBand gridBand9;
        private GridColumn gridColumn1;
        private GridColumn gridColumn10;
        private GridColumn gridColumn11;
        private GridColumn gridColumn12;
        private GridColumn gridColumn13;
        private GridColumn gridColumn14;
        private GridColumn gridColumn15;
        private GridColumn gridColumn16;
        private GridColumn gridColumn17;
        private GridColumn gridColumn18;
        private GridColumn gridColumn19;
        private GridColumn gridColumn2;
        private GridColumn gridColumn20;
        private GridColumn gridColumn3;
        private GridColumn gridColumn4;
        private GridColumn gridColumn5;
        private GridColumn gridColumn6;
        private GridColumn gridColumn7;
        private GridColumn gridColumn8;
        private GridColumn gridColumn9;
        public DevExpress.Utils.ImageCollection imageCollection2;
        private DevExpress.Utils.ImageCollection imgList;
        private int m_IndexKey = 1;
        private RepositoryItemDateEdit repBeginDate;
        private RepositoryItemCalcEdit repCal;
        private RepositoryItemDateEdit repEndDate;
        private RepositoryItemTimeEdit repMonth;
        private RepositoryItemImageComboBox repositoryItemImageComboBox1;
        private RepositoryItemImageComboBox repStatus;
        private RepositoryItemTimeEdit repYear;
        private RepositoryItemPictureEdit rptPhoto;

        public event ClosedHander Closed;

        public xucListPetition()
        {
            this.InitializeComponent();
            this.InitData();
            this.ReLoad();
        }

        private void Add()
        {
            if (MyRule.IsAdd("bbiProcessPetition"))
            {
                xfmPetitionAdd add = new xfmPetitionAdd(Actions.Add, "");
                add.Added += new xfmPetitionAdd.AddedEventHander(this.frm_Added);
                add.ShowDialog();
            }
        }

        private void AddRow(HRM_PROCESS_PETITION item)
        {
            GridView gbList = this.gbList;
            int focusedRowHandle = gbList.FocusedRowHandle;
            gbList.AddNewRow();
            focusedRowHandle = gbList.FocusedRowHandle;
            gbList.SetRowCellValue(focusedRowHandle, "PetitionID", item.PetitionID);
            gbList.SetRowCellValue(focusedRowHandle, "EmployeeCode", item.EmployeeCode);
            HRM_EMPLOYEE hrm_employee = new HRM_EMPLOYEE();
            hrm_employee.Get(item.EmployeeCode);
            gbList.SetRowCellValue(focusedRowHandle, "FirstName", hrm_employee.FirstName);
            gbList.SetRowCellValue(focusedRowHandle, "LastName", hrm_employee.LastName);
            gbList.SetRowCellValue(focusedRowHandle, "WriteDate", item.WriteDate);
            gbList.SetRowCellValue(focusedRowHandle, "WriteFromDate", item.WriteFromDate);
            gbList.SetRowCellValue(focusedRowHandle, "WriteToDate", item.WriteToDate);
            gbList.SetRowCellValue(focusedRowHandle, "RestFromDate", item.RestFromDate);
            gbList.SetRowCellValue(focusedRowHandle, "RestToDate", item.RestToDate);
            gbList.SetRowCellValue(focusedRowHandle, "Symbol", item.Symbol);
            gbList.SetRowCellValue(focusedRowHandle, "Reason", item.Reason);
            gbList.SetRowCellValue(focusedRowHandle, "Status", item.Status);
            gbList.SetRowCellValue(focusedRowHandle, "ReasonCannot", item.ReasonCannot);
            gbList.SetRowCellValue(focusedRowHandle, "Description", item.Description);
            gbList.UpdateCurrentRow();
        }

        private void bbiAddWork_ItemClick(object sender, ItemClickEventArgs e)
        {
            this.Add();
        }

        private void bbiClose_ItemClick(object sender, ItemClickEventArgs e)
        {
            base.ParentForm.Close();
        }

        private void bbiDelete_ItemClick(object sender, ItemClickEventArgs e)
        {
            if (MyRule.IsDelete("bbiProcessPetition"))
            {
                bool flag = false;
                int[] selectedRows = this.gbList.GetSelectedRows();
                if (XtraMessageBox.Show("Bạn c\x00f3 muốn x\x00f3a kh\x00f4ng?", "Th\x00f4ng b\x00e1o", MessageBoxButtons.YesNo, MessageBoxIcon.Question) != DialogResult.No)
                {
                    string str;
                    object rowCellValue;
                    base.SetWaitDialogCaption("Đang x\x00f3a...");
                    HRM_PROCESS_PETITION hrm_process_petition = new HRM_PROCESS_PETITION();
                    for (int i = selectedRows.Length; i > 0; i--)
                    {
                        flag = true;
                        rowCellValue = this.gbList.GetRowCellValue(selectedRows[i - 1], "PetitionID");
                        if (rowCellValue != null)
                        {
                            SYS_LOG.Insert("Đơn Xin Nghỉ Ph\x00e9p", "Xo\x00e1", rowCellValue.ToString());
                            str = hrm_process_petition.Delete(new Guid(rowCellValue.ToString()));
                            if (str == "OK")
                            {
                                this.gbList.DeleteRow(selectedRows[i - 1]);
                            }
                            else if (str != "OK")
                            {
                                MessageBox.Show("Th\x00f4ng tin kh\x00f4ng được x\x00f3a" + str, "Th\x00f4ng b\x00e1o", MessageBoxButtons.OK, MessageBoxIcon.Hand);
                            }
                        }
                    }
                    this.DoHide();
                    if (!flag)
                    {
                        rowCellValue = this.gbList.GetFocusedRowCellValue("PetitionID");
                        if (rowCellValue != null)
                        {
                            SYS_LOG.Insert("Đơn Xin Nghỉ Ph\x00e9p", "Xo\x00e1", rowCellValue.ToString());
                            base.SetWaitDialogCaption("Đang x\x00f3a...");
                            str = hrm_process_petition.Delete(new Guid(rowCellValue.ToString()));
                            if (str == "OK")
                            {
                                this.gbList.DeleteRow(this.gbList.FocusedRowHandle);
                            }
                            else if (str != "OK")
                            {
                                MessageBox.Show("Th\x00f4ng tin kh\x00f4ng được x\x00f3a\r\n" + str, "Th\x00f4ng b\x00e1o", MessageBoxButtons.OK, MessageBoxIcon.Hand);
                            }
                            this.DoHide();
                        }
                    }
                }
            }
        }

        private void bbiEdit_ItemClick(object sender, ItemClickEventArgs e)
        {
            this.Change();
        }

        private void bbiExport_ItemClick(object sender, ItemClickEventArgs e)
        {
            base._exportView = this.gbList;
            SYS_LOG.Insert("Đơn Xin Nghỉ Ph\x00e9p", "Xuất");
            base.Export();
        }

        private void bbiFilter_EditValueChanged(object sender, EventArgs e)
        {
            this.m_IndexKey = int.Parse(this.bbiFilter.EditValue.ToString());
            if (this.m_IndexKey == 0)
            {
                this.bbeBeginDate.Enabled = false;
                this.bbeEndDate.Enabled = false;
            }
            else
            {
                this.bbeBeginDate.Enabled = true;
                this.bbeEndDate.Enabled = true;
            }
            this.LoadGrid();
        }

        private void bbiPrint_ItemClick(object sender, ItemClickEventArgs e)
        {
            rptListPetition petition;
            SYS_LOG.Insert("Đơn Xin Nghỉ Ph\x00e9p", "In");
            xfmReport report = new xfmReport();
            report.SetTitle("Sổ Theo D\x00f5i Nghỉ Ph\x00e9p");
            if (this.m_IndexKey == 0)
            {
                petition = new rptListPetition();
            }
            else
            {
                petition = new rptListPetition(System.DateTime.Parse(this.bbeBeginDate.EditValue.ToString()), System.DateTime.Parse(this.bbeEndDate.EditValue.ToString()));
            }
            report.ShowPrintPreview(petition);
        }

        private void bbiRefresh_ItemClick(object sender, ItemClickEventArgs e)
        {
            this.ReLoad();
        }

        private void Change()
        {
            if (MyRule.IsAccess("bbiProcessPetition"))
            {
                HRM_PROCESS_PETITION item = new HRM_PROCESS_PETITION();
                object focusedRowCellValue = this.gbList.GetFocusedRowCellValue("PetitionID");
                if (focusedRowCellValue != null)
                {
                    base.SetWaitDialogCaption("Đang kiểm tra dữ liệu....");
                    if (item.Get(new Guid(focusedRowCellValue.ToString())) != "OK")
                    {
                        this.DoHide();
                        XtraMessageBox.Show("Dữ liệu kh\x00f4ng tồn tại", "Th\x00f4ng B\x00e1o", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                    }
                    else
                    {
                        this.DoHide();
                        xfmPetitionAdd add = new xfmPetitionAdd(Actions.Update, item);
                        add.Updated += new xfmPetitionAdd.UpdatedEventHander(this.frm_Updated);
                        add.Added += new xfmPetitionAdd.AddedEventHander(this.frm_Added);
                        add.ShowDialog();
                    }
                }
            }
        }

        public void DisableMenu(bool disable)
        {
        }

        protected override void Dispose(bool disposing)
        {
            if (disposing && (this.components != null))
            {
                this.components.Dispose();
            }
            base.Dispose(disposing);
        }

        protected void DoShowMenu(GridHitInfo hi)
        {
            if (hi.HitTest == GridHitTest.ColumnButton)
            {
                GridViewMenu menu = new GridViewColumnButtonMenu(this.gbList);
                menu.Init(hi);
                menu.Show(hi.HitPoint);
            }
        }

        private void frm_Added(object sender, HRM_PROCESS_PETITION Item)
        {
            this.AddRow(Item);
        }

        private void frm_Updated(object sender, HRM_PROCESS_PETITION Item)
        {
            this.UpdateRow(Item);
        }

        private void gbList_CustomDrawRowIndicator(object sender, RowIndicatorCustomDrawEventArgs e)
        {
            if (e.RowHandle == -2147483648)
            {
                e.Handled = true;
                e.Painter.DrawObject(e.Info);
                Rectangle bounds = e.Bounds;
                e.Graphics.FillRectangle(new SolidBrush(Color.FromArgb(0x3f, 0xa5, 0xa5, 0)), bounds);
                bounds.Height--;
                bounds.Width--;
                e.Graphics.DrawRectangle(Pens.Blue, bounds);
            }
            int rowHandle = e.RowHandle;
            if (rowHandle >= 0)
            {
                rowHandle++;
                e.Info.DisplayText = rowHandle.ToString();
            }
        }

        private void gbList_DoubleClick(object sender, EventArgs e)
        {
            if (this.gbList.RowCount != 0)
            {
                this.Change();
            }
        }

        private void gbList_FocusedRowChanged(object sender, FocusedRowChangedEventArgs e)
        {
        }

        private void gbList_KeyDown(object sender, KeyEventArgs e)
        {
            this.ucList_ListKeyDown(sender, e);
            if ((e.KeyCode == Keys.Delete) && (this.gbList.RowCount != 0))
            {
                this.Delete();
                this.SetMenu(null);
            }
        }

        private void gbList_MouseDown(object sender, MouseEventArgs e)
        {
            if (e.Button == MouseButtons.Left)
            {
                this.DoShowMenu(this.gbList.CalcHitInfo(new Point(e.X, e.Y)));
            }
            this.SetMenu(null);
        }

        private void gbList_RowCellClick(object sender, RowCellClickEventArgs e)
        {
            Common.Class.RowClickEventArgs args = new Common.Class.RowClickEventArgs(e.RowHandle, e.Column.ColumnHandle);
            this.SetMenu(args);
        }

        private void InitData()
        {
            System.DateTime now;
            try
            {
                now = DateAndTime.DateAdd(DateInterval.Month, -6.0, System.DateTime.Now);
            }
            catch
            {
                now = System.DateTime.Now;
            }
            this.bbeBeginDate.EditValue = now;
            this.bbeEndDate.EditValue = DateAndTime.DateAdd(DateInterval.Day, 1.0, System.DateTime.Today);
        }

        private void InitializeComponent()
        {
            this.components = new Container();
            ComponentResourceManager manager = new ComponentResourceManager(typeof(xucListPetition));
            StyleFormatCondition condition = new StyleFormatCondition();
            StyleFormatCondition condition2 = new StyleFormatCondition();
            this.colStatus = new BandedGridColumn();
            this.repStatus = new RepositoryItemImageComboBox();
            this.rptPhoto = new RepositoryItemPictureEdit();
            this.gridColumn1 = new GridColumn();
            this.gridColumn2 = new GridColumn();
            this.gridColumn3 = new GridColumn();
            this.gridColumn4 = new GridColumn();
            this.gridColumn5 = new GridColumn();
            this.gridColumn6 = new GridColumn();
            this.gridColumn7 = new GridColumn();
            this.gridColumn8 = new GridColumn();
            this.gridColumn9 = new GridColumn();
            this.gridColumn10 = new GridColumn();
            this.gridColumn11 = new GridColumn();
            this.gridColumn12 = new GridColumn();
            this.gridColumn13 = new GridColumn();
            this.gridColumn14 = new GridColumn();
            this.gridColumn15 = new GridColumn();
            this.gridColumn16 = new GridColumn();
            this.gridColumn17 = new GridColumn();
            this.gridColumn18 = new GridColumn();
            this.gridColumn19 = new GridColumn();
            this.gridColumn20 = new GridColumn();
            this.barManager1 = new BarManager(this.components);
            this.bar1 = new Bar();
            this.bbiAddEmployee = new BarButtonItem();
            this.bbiEdit = new BarButtonItem();
            this.bbiDelete = new BarButtonItem();
            this.bbiFilter = new BarEditItem();
            this.repositoryItemImageComboBox1 = new RepositoryItemImageComboBox();
            this.bbeBeginDate = new BarEditItem();
            this.repBeginDate = new RepositoryItemDateEdit();
            this.bbeEndDate = new BarEditItem();
            this.repEndDate = new RepositoryItemDateEdit();
            this.bbiPrint = new BarButtonItem();
            this.bbiExport = new BarButtonItem();
            this.bbiRefresh = new BarButtonItem();
            this.bbiClose = new BarButtonItem();
            this.barDockControlTop = new BarDockControl();
            this.barDockControlBottom = new BarDockControl();
            this.barDockControlLeft = new BarDockControl();
            this.barDockControlRight = new BarDockControl();
            this.imageCollection2 = new DevExpress.Utils.ImageCollection(this.components);
            this.repMonth = new RepositoryItemTimeEdit();
            this.repYear = new RepositoryItemTimeEdit();
            this.imgList = new DevExpress.Utils.ImageCollection(this.components);
            this.gcList = new GridControl();
            this.gbList = new BandedGridView();
            this.gridBand2 = new GridBand();
            this.colEmployeeCode = new BandedGridColumn();
            this.colFirstName = new BandedGridColumn();
            this.colLastName = new BandedGridColumn();
            this.colBranchName = new BandedGridColumn();
            this.colDepartmentName = new BandedGridColumn();
            this.colGroupName = new BandedGridColumn();
            this.gridBand9 = new GridBand();
            this.colWriteDate = new BandedGridColumn();
            this.gridBand3 = new GridBand();
            this.colWriteFromDate = new BandedGridColumn();
            this.colWriteToDate = new BandedGridColumn();
            this.gridBand5 = new GridBand();
            this.gridBand8 = new GridBand();
            this.colRestFromDate = new BandedGridColumn();
            this.colRestToDate = new BandedGridColumn();
            this.gridBand7 = new GridBand();
            this.colSymbol = new BandedGridColumn();
            this.colReason = new BandedGridColumn();
            this.gridBand1 = new GridBand();
            this.colReasonCannot = new BandedGridColumn();
            this.colDescription = new BandedGridColumn();
            this.colPetitionID = new BandedGridColumn();
            this.repCal = new RepositoryItemCalcEdit();
            this.repStatus.BeginInit();
            this.rptPhoto.BeginInit();
            this.barManager1.BeginInit();
            this.repositoryItemImageComboBox1.BeginInit();
            this.repBeginDate.BeginInit();
            this.repBeginDate.VistaTimeProperties.BeginInit();
            this.repEndDate.BeginInit();
            this.repEndDate.VistaTimeProperties.BeginInit();
            this.imageCollection2.BeginInit();
            this.repMonth.BeginInit();
            this.repYear.BeginInit();
            this.imgList.BeginInit();
            this.gcList.BeginInit();
            this.gbList.BeginInit();
            this.repCal.BeginInit();
            base.SuspendLayout();
            this.colStatus.Caption = "Trạng th\x00e1i";
            this.colStatus.ColumnEdit = this.repStatus;
            this.colStatus.FieldName = "Status";
            this.colStatus.Name = "colStatus";
            this.colStatus.OptionsColumn.AllowEdit = false;
            this.colStatus.OptionsColumn.AllowMerge = DefaultBoolean.False;
            this.colStatus.Visible = true;
            this.colStatus.Width = 0x5e;
            this.repStatus.AutoHeight = false;
            this.repStatus.Buttons.AddRange(new EditorButton[] { new EditorButton(ButtonPredefines.Combo) });
            this.repStatus.Items.AddRange(new ImageComboBoxItem[] { new ImageComboBoxItem("Chờ duyệt", 0, -1), new ImageComboBoxItem("Đ\x00e3 duyệt", 1, -1), new ImageComboBoxItem("Kh\x00f4ng được duyệt", 2, -1) });
            this.repStatus.Name = "repStatus";
            this.rptPhoto.CustomHeight = 0x30;
            this.rptPhoto.Name = "rptPhoto";
            this.rptPhoto.NullText = "[Chưa chọn h\x00ecnh]";
            this.rptPhoto.SizeMode = PictureSizeMode.Zoom;
            this.gridColumn1.Caption = "Chi nh\x00e1nh";
            this.gridColumn1.FieldName = "BranchName";
            this.gridColumn1.Name = "gridColumn1";
            this.gridColumn1.Visible = true;
            this.gridColumn1.VisibleIndex = 0;
            this.gridColumn2.Caption = "Ph\x00f2ng ban";
            this.gridColumn2.FieldName = "DepartmentName";
            this.gridColumn2.Name = "gridColumn2";
            this.gridColumn2.Visible = true;
            this.gridColumn2.VisibleIndex = 1;
            this.gridColumn3.Caption = "Tổ nh\x00f3m";
            this.gridColumn3.FieldName = "GroupName";
            this.gridColumn3.Name = "gridColumn3";
            this.gridColumn3.Visible = true;
            this.gridColumn3.VisibleIndex = 2;
            this.gridColumn4.Caption = "H\x00ecnh ảnh";
            this.gridColumn4.ColumnEdit = this.rptPhoto;
            this.gridColumn4.FieldName = "Photo";
            this.gridColumn4.Fixed = FixedStyle.Left;
            this.gridColumn4.Name = "gridColumn4";
            this.gridColumn4.OptionsColumn.AllowEdit = false;
            this.gridColumn4.OptionsColumn.ReadOnly = true;
            this.gridColumn4.Visible = true;
            this.gridColumn4.VisibleIndex = 3;
            this.gridColumn5.Caption = "M\x00e3 nh\x00e2n vi\x00ean";
            this.gridColumn5.FieldName = "EmployeeCode";
            this.gridColumn5.Fixed = FixedStyle.Left;
            this.gridColumn5.Name = "gridColumn5";
            this.gridColumn5.OptionsColumn.AllowEdit = false;
            this.gridColumn5.OptionsColumn.ReadOnly = true;
            this.gridColumn5.Visible = true;
            this.gridColumn5.VisibleIndex = 4;
            this.gridColumn5.Width = 0x4a;
            this.gridColumn6.Caption = "Họ l\x00f3t";
            this.gridColumn6.FieldName = "FirstName";
            this.gridColumn6.Fixed = FixedStyle.Left;
            this.gridColumn6.Name = "gridColumn6";
            this.gridColumn6.OptionsColumn.AllowEdit = false;
            this.gridColumn6.OptionsColumn.ReadOnly = true;
            this.gridColumn6.Visible = true;
            this.gridColumn6.VisibleIndex = 5;
            this.gridColumn6.Width = 110;
            this.gridColumn7.Caption = "T\x00ean";
            this.gridColumn7.FieldName = "LastName";
            this.gridColumn7.Fixed = FixedStyle.Left;
            this.gridColumn7.Name = "gridColumn7";
            this.gridColumn7.OptionsColumn.AllowEdit = false;
            this.gridColumn7.OptionsColumn.ReadOnly = true;
            this.gridColumn7.Visible = true;
            this.gridColumn7.VisibleIndex = 6;
            this.gridColumn7.Width = 0x42;
            this.gridColumn8.Caption = "Giới t\x00ednh";
            this.gridColumn8.FieldName = "Sex";
            this.gridColumn8.Name = "gridColumn8";
            this.gridColumn8.OptionsColumn.AllowEdit = false;
            this.gridColumn8.OptionsColumn.ReadOnly = true;
            this.gridColumn8.Visible = true;
            this.gridColumn8.VisibleIndex = 7;
            this.gridColumn8.Width = 0x38;
            this.gridColumn9.Caption = "Ng\x00e0y sinh";
            this.gridColumn9.FieldName = "Birthday";
            this.gridColumn9.Name = "gridColumn9";
            this.gridColumn9.OptionsColumn.AllowEdit = false;
            this.gridColumn9.OptionsColumn.ReadOnly = true;
            this.gridColumn9.Visible = true;
            this.gridColumn9.VisibleIndex = 8;
            this.gridColumn9.Width = 0x42;
            this.gridColumn10.Caption = "Nơi sinh";
            this.gridColumn10.FieldName = "BirthPlace";
            this.gridColumn10.Name = "gridColumn10";
            this.gridColumn10.OptionsColumn.AllowEdit = false;
            this.gridColumn10.OptionsColumn.ReadOnly = true;
            this.gridColumn10.Visible = true;
            this.gridColumn10.VisibleIndex = 9;
            this.gridColumn10.Width = 0x6f;
            this.gridColumn11.Caption = "Điện thoại";
            this.gridColumn11.FieldName = "CellPhone";
            this.gridColumn11.Name = "gridColumn11";
            this.gridColumn11.OptionsColumn.AllowEdit = false;
            this.gridColumn11.OptionsColumn.ReadOnly = true;
            this.gridColumn11.Visible = true;
            this.gridColumn11.VisibleIndex = 10;
            this.gridColumn11.Width = 0x53;
            this.gridColumn12.Caption = "Địa chỉ";
            this.gridColumn12.FieldName = "MainAddress";
            this.gridColumn12.Name = "gridColumn12";
            this.gridColumn12.OptionsColumn.AllowEdit = false;
            this.gridColumn12.OptionsColumn.ReadOnly = true;
            this.gridColumn12.Visible = true;
            this.gridColumn12.VisibleIndex = 11;
            this.gridColumn12.Width = 0x13f;
            this.gridColumn13.Caption = "Chức vụ";
            this.gridColumn13.FieldName = "Position";
            this.gridColumn13.Name = "gridColumn13";
            this.gridColumn13.OptionsColumn.AllowEdit = false;
            this.gridColumn13.Visible = true;
            this.gridColumn13.VisibleIndex = 12;
            this.gridColumn13.Width = 0x8b;
            this.gridColumn14.Caption = "CMND";
            this.gridColumn14.FieldName = "IDCard";
            this.gridColumn14.Name = "gridColumn14";
            this.gridColumn14.OptionsColumn.AllowEdit = false;
            this.gridColumn14.OptionsColumn.ReadOnly = true;
            this.gridColumn14.Visible = true;
            this.gridColumn14.VisibleIndex = 13;
            this.gridColumn14.Width = 0x54;
            this.gridColumn15.Caption = "Ng\x00e0y cấp";
            this.gridColumn15.FieldName = "IDCardDate";
            this.gridColumn15.Name = "gridColumn15";
            this.gridColumn15.OptionsColumn.AllowEdit = false;
            this.gridColumn15.OptionsColumn.ReadOnly = true;
            this.gridColumn15.Visible = true;
            this.gridColumn15.VisibleIndex = 14;
            this.gridColumn16.Caption = "Nơi cấp";
            this.gridColumn16.FieldName = "IDCardPlace";
            this.gridColumn16.Name = "gridColumn16";
            this.gridColumn16.OptionsColumn.AllowEdit = false;
            this.gridColumn16.OptionsColumn.ReadOnly = true;
            this.gridColumn16.Visible = true;
            this.gridColumn16.VisibleIndex = 15;
            this.gridColumn16.Width = 0x73;
            this.gridColumn17.Caption = "Trạng th\x00e1i";
            this.gridColumn17.FieldName = "Status";
            this.gridColumn17.Name = "gridColumn17";
            this.gridColumn17.OptionsColumn.AllowEdit = false;
            this.gridColumn17.OptionsColumn.ReadOnly = true;
            this.gridColumn17.Visible = true;
            this.gridColumn17.VisibleIndex = 0x10;
            this.gridColumn18.Caption = "Ng\x00e0y BD thử việc";
            this.gridColumn18.FieldName = "TestFromDate";
            this.gridColumn18.Name = "gridColumn18";
            this.gridColumn18.OptionsColumn.AllowEdit = false;
            this.gridColumn18.OptionsColumn.ReadOnly = true;
            this.gridColumn18.Visible = true;
            this.gridColumn18.VisibleIndex = 0x11;
            this.gridColumn19.Caption = "Ng\x00e0y KT thử việc";
            this.gridColumn19.FieldName = "TestToDate";
            this.gridColumn19.Name = "gridColumn19";
            this.gridColumn19.OptionsColumn.AllowEdit = false;
            this.gridColumn19.OptionsColumn.ReadOnly = true;
            this.gridColumn19.Visible = true;
            this.gridColumn19.VisibleIndex = 0x12;
            this.gridColumn20.Caption = "Ng\x00e0y nghỉ";
            this.gridColumn20.FieldName = "EndDate";
            this.gridColumn20.Name = "gridColumn20";
            this.gridColumn20.OptionsColumn.AllowEdit = false;
            this.gridColumn20.OptionsColumn.ReadOnly = true;
            this.gridColumn20.Visible = true;
            this.gridColumn20.VisibleIndex = 0x13;
            this.barManager1.Bars.AddRange(new Bar[] { this.bar1 });
            this.barManager1.DockControls.Add(this.barDockControlTop);
            this.barManager1.DockControls.Add(this.barDockControlBottom);
            this.barManager1.DockControls.Add(this.barDockControlLeft);
            this.barManager1.DockControls.Add(this.barDockControlRight);
            this.barManager1.Form = this;
            this.barManager1.Images = this.imageCollection2;
            this.barManager1.Items.AddRange(new BarItem[] { this.bbiAddEmployee, this.bbiEdit, this.bbiDelete, this.bbiPrint, this.bbiRefresh, this.bbiClose, this.bbiExport, this.bbiFilter, this.bbeBeginDate, this.bbeEndDate });
            this.barManager1.MaxItemId = 0x22;
            this.barManager1.RepositoryItems.AddRange(new RepositoryItem[] { this.repositoryItemImageComboBox1, this.repBeginDate, this.repEndDate, this.repMonth, this.repYear });
            this.bar1.BarName = "Tools";
            this.bar1.DockCol = 0;
            this.bar1.DockRow = 0;
            this.bar1.DockStyle = BarDockStyle.Top;
            this.bar1.LinksPersistInfo.AddRange(new LinkPersistInfo[] { new LinkPersistInfo(BarLinkUserDefines.PaintStyle, this.bbiAddEmployee, "", true, true, true, 0, null, BarItemPaintStyle.CaptionGlyph), new LinkPersistInfo(BarLinkUserDefines.PaintStyle, this.bbiEdit, BarItemPaintStyle.CaptionGlyph), new LinkPersistInfo(BarLinkUserDefines.PaintStyle, this.bbiDelete, BarItemPaintStyle.CaptionGlyph), new LinkPersistInfo(BarLinkUserDefines.PaintStyle, this.bbiFilter, "", true, true, true, 0, null, BarItemPaintStyle.CaptionGlyph), new LinkPersistInfo(BarLinkUserDefines.PaintStyle, this.bbeBeginDate, "", true, true, true, 0, null, BarItemPaintStyle.CaptionGlyph), new LinkPersistInfo(BarLinkUserDefines.PaintStyle, this.bbeEndDate, BarItemPaintStyle.CaptionGlyph), new LinkPersistInfo(BarLinkUserDefines.PaintStyle, this.bbiPrint, "", true, true, true, 0, null, BarItemPaintStyle.CaptionGlyph), new LinkPersistInfo(BarLinkUserDefines.PaintStyle, this.bbiExport, BarItemPaintStyle.CaptionGlyph), new LinkPersistInfo(BarLinkUserDefines.PaintStyle, this.bbiRefresh, "", true, true, true, 0, null, BarItemPaintStyle.CaptionGlyph), new LinkPersistInfo(BarLinkUserDefines.PaintStyle, this.bbiClose, BarItemPaintStyle.CaptionGlyph) });
            this.bar1.OptionsBar.UseWholeRow = true;
            this.bar1.Text = "Tools";
            this.bbiAddEmployee.Caption = "Th\x00eam";
            this.bbiAddEmployee.Id = 3;
            this.bbiAddEmployee.ImageIndex = 0x42;
            this.bbiAddEmployee.Name = "bbiAddEmployee";
            this.bbiAddEmployee.ItemClick += new ItemClickEventHandler(this.bbiAddWork_ItemClick);
            this.bbiEdit.Caption = "Sửa";
            this.bbiEdit.Id = 4;
            this.bbiEdit.ImageIndex = 14;
            this.bbiEdit.Name = "bbiEdit";
            this.bbiEdit.ItemClick += new ItemClickEventHandler(this.bbiEdit_ItemClick);
            this.bbiDelete.Caption = "X\x00f3a";
            this.bbiDelete.Id = 5;
            this.bbiDelete.ImageIndex = 13;
            this.bbiDelete.Name = "bbiDelete";
            this.bbiDelete.ItemClick += new ItemClickEventHandler(this.bbiDelete_ItemClick);
            this.bbiFilter.Caption = "Lọc:";
            this.bbiFilter.Edit = this.repositoryItemImageComboBox1;
            this.bbiFilter.Id = 10;
            this.bbiFilter.Name = "bbiFilter";
            this.bbiFilter.Width = 120;
            this.repositoryItemImageComboBox1.Appearance.Font = new Font("Tahoma", 8.25f, FontStyle.Bold);
            this.repositoryItemImageComboBox1.Appearance.Options.UseFont = true;
            this.repositoryItemImageComboBox1.AutoHeight = false;
            this.repositoryItemImageComboBox1.Buttons.AddRange(new EditorButton[] { new EditorButton(ButtonPredefines.Combo) });
            this.repositoryItemImageComboBox1.Items.AddRange(new ImageComboBoxItem[] { new ImageComboBoxItem("<Tất cả>", 0, -1), new ImageComboBoxItem("<Theo thời gian>", 1, -1) });
            this.repositoryItemImageComboBox1.Name = "repositoryItemImageComboBox1";
            this.bbeBeginDate.Caption = "Từ ng\x00e0y:";
            this.bbeBeginDate.Edit = this.repBeginDate;
            this.bbeBeginDate.Id = 30;
            this.bbeBeginDate.Name = "bbeBeginDate";
            this.bbeBeginDate.Width = 80;
            this.repBeginDate.AutoHeight = false;
            this.repBeginDate.Buttons.AddRange(new EditorButton[] { new EditorButton(ButtonPredefines.Combo) });
            this.repBeginDate.Name = "repBeginDate";
            this.repBeginDate.VistaTimeProperties.Buttons.AddRange(new EditorButton[] { new EditorButton() });
            this.bbeEndDate.Caption = "Đến ng\x00e0y:";
            this.bbeEndDate.Edit = this.repEndDate;
            this.bbeEndDate.Id = 0x1f;
            this.bbeEndDate.Name = "bbeEndDate";
            this.bbeEndDate.Width = 80;
            this.repEndDate.AutoHeight = false;
            this.repEndDate.Buttons.AddRange(new EditorButton[] { new EditorButton(ButtonPredefines.Combo) });
            this.repEndDate.Name = "repEndDate";
            this.repEndDate.VistaTimeProperties.Buttons.AddRange(new EditorButton[] { new EditorButton() });
            this.bbiPrint.Caption = "In";
            this.bbiPrint.Id = 6;
            this.bbiPrint.ImageIndex = 9;
            this.bbiPrint.Name = "bbiPrint";
            this.bbiPrint.ItemClick += new ItemClickEventHandler(this.bbiPrint_ItemClick);
            this.bbiExport.Caption = "Xuất";
            this.bbiExport.Id = 9;
            this.bbiExport.ImageIndex = 0x31;
            this.bbiExport.Name = "bbiExport";
            this.bbiExport.ItemClick += new ItemClickEventHandler(this.bbiExport_ItemClick);
            this.bbiRefresh.Caption = "Nạp Lại";
            this.bbiRefresh.Id = 7;
            this.bbiRefresh.ImageIndex = 0x2a;
            this.bbiRefresh.Name = "bbiRefresh";
            this.bbiRefresh.ItemClick += new ItemClickEventHandler(this.bbiRefresh_ItemClick);
            this.bbiClose.Caption = "Đ\x00f3ng";
            this.bbiClose.Id = 8;
            this.bbiClose.ImageIndex = 0x16;
            this.bbiClose.Name = "bbiClose";
            this.bbiClose.ItemClick += new ItemClickEventHandler(this.bbiClose_ItemClick);
            this.imageCollection2.ImageStream = (ImageCollectionStreamer) manager.GetObject("imageCollection2.ImageStream");
            this.imageCollection2.Images.SetKeyName(0x3d, "Vista (35).ico");
            this.imageCollection2.Images.SetKeyName(0x3e, "Security.ico");
            this.imageCollection2.Images.SetKeyName(0x3f, "RibbonPrintPreview_DocumentMapLarge.png");
            this.imageCollection2.Images.SetKeyName(0x40, "11.png");
            this.imageCollection2.Images.SetKeyName(0x41, "Sua.png");
            this.imageCollection2.Images.SetKeyName(0x42, "Them.png");
            this.imageCollection2.Images.SetKeyName(0x43, "PhanQuyen.png");
            this.imageCollection2.Images.SetKeyName(0x44, "11.png");
            this.imageCollection2.Images.SetKeyName(0x45, "plus.png");
            this.repMonth.AutoHeight = false;
            this.repMonth.Buttons.AddRange(new EditorButton[] { new EditorButton() });
            this.repMonth.Mask.EditMask = "MM";
            this.repMonth.Name = "repMonth";
            this.repYear.AutoHeight = false;
            this.repYear.Buttons.AddRange(new EditorButton[] { new EditorButton() });
            this.repYear.Mask.EditMask = "yyyy";
            this.repYear.Name = "repYear";
            this.imgList.ImageStream = (ImageCollectionStreamer) manager.GetObject("imgList.ImageStream");
            this.imgList.Images.SetKeyName(0, "male.png");
            this.imgList.Images.SetKeyName(1, "user_woman.png");
            this.gcList.Dock = DockStyle.Fill;
            this.gcList.EmbeddedNavigator.Buttons.Append.Visible = false;
            this.gcList.EmbeddedNavigator.Buttons.CancelEdit.Visible = false;
            this.gcList.EmbeddedNavigator.Buttons.Edit.Visible = false;
            this.gcList.EmbeddedNavigator.Buttons.EndEdit.Visible = false;
            this.gcList.EmbeddedNavigator.Buttons.Remove.Visible = false;
            this.gcList.EmbeddedNavigator.TextStringFormat = "{0}/{1}";
            this.gcList.Location = new Point(0, 0x1a);
            this.gcList.MainView = this.gbList;
            this.gcList.Name = "gcList";
            this.gcList.RepositoryItems.AddRange(new RepositoryItem[] { this.repCal, this.repStatus });
            this.gcList.Size = new Size(0x4ab, 0x255);
            this.gcList.TabIndex = 7;
            this.gcList.UseEmbeddedNavigator = true;
            this.gcList.ViewCollection.AddRange(new BaseView[] { this.gbList });
            this.gbList.Appearance.GroupRow.Font = new Font("Tahoma", 8.25f, FontStyle.Bold);
            this.gbList.Appearance.GroupRow.Options.UseFont = true;
            this.gbList.Appearance.HeaderPanel.Options.UseTextOptions = true;
            this.gbList.Appearance.HeaderPanel.TextOptions.HAlignment = HorzAlignment.Center;
            this.gbList.Appearance.HeaderPanel.TextOptions.WordWrap = WordWrap.Wrap;
            this.gbList.Bands.AddRange(new GridBand[] { this.gridBand2, this.gridBand9, this.gridBand3, this.gridBand5, this.gridBand8, this.gridBand7, this.gridBand1 });
            this.gbList.BorderStyle = BorderStyles.NoBorder;
            this.gbList.ColumnPanelRowHeight = 0x20;
            this.gbList.Columns.AddRange(new BandedGridColumn[] { 
                this.colPetitionID, this.colEmployeeCode, this.colFirstName, this.colLastName, this.colBranchName, this.colDepartmentName, this.colGroupName, this.colWriteDate, this.colWriteFromDate, this.colWriteToDate, this.colRestFromDate, this.colRestToDate, this.colSymbol, this.colReason, this.colStatus, this.colReasonCannot, 
                this.colDescription
             });
            this.gbList.FixedLineWidth = 1;
            this.gbList.FocusRectStyle = DrawFocusRectStyle.RowFocus;
            condition.Appearance.ForeColor = Color.DarkGreen;
            condition.Appearance.Options.UseForeColor = true;
            condition.ApplyToRow = true;
            condition.Column = this.colStatus;
            condition.Condition = FormatConditionEnum.Equal;
            condition.Value1 = "1";
            condition2.Appearance.ForeColor = Color.Red;
            condition2.Appearance.Options.UseForeColor = true;
            condition2.ApplyToRow = true;
            condition2.Column = this.colStatus;
            condition2.Condition = FormatConditionEnum.Equal;
            condition2.Value1 = "2";
            this.gbList.FormatConditions.AddRange(new StyleFormatCondition[] { condition, condition2 });
            this.gbList.GridControl = this.gcList;
            this.gbList.GroupPanelText = "K\x00e9o v\x00e0 Thả cột v\x00e0o đ\x00e2y để nh\x00f3m dữ liệu";
            this.gbList.GroupSummary.AddRange(new GridSummaryItem[] { new GridGroupSummaryItem(SummaryItemType.Sum, "WorkTotal", this.colWriteDate, ""), new GridGroupSummaryItem(SummaryItemType.Sum, "RealDay", this.colWriteFromDate, ""), new GridGroupSummaryItem(SummaryItemType.Sum, "RegulationDay", this.colWriteToDate, ""), new GridGroupSummaryItem(SummaryItemType.Sum, "FurloughDay", this.colRestFromDate, ""), new GridGroupSummaryItem(SummaryItemType.Sum, "CompensationDay", this.colRestToDate, "") });
            this.gbList.IndicatorWidth = 40;
            this.gbList.Name = "gbList";
            this.gbList.OptionsBehavior.AllowIncrementalSearch = true;
            this.gbList.OptionsBehavior.AutoExpandAllGroups = true;
            this.gbList.OptionsBehavior.CopyToClipboardWithColumnHeaders = false;
            this.gbList.OptionsBehavior.FocusLeaveOnTab = true;
            this.gbList.OptionsCustomization.AllowFilter = false;
            this.gbList.OptionsFilter.AllowColumnMRUFilterList = false;
            this.gbList.OptionsFilter.AllowFilterEditor = false;
            this.gbList.OptionsFilter.AllowMRUFilterList = false;
            this.gbList.OptionsLayout.StoreAllOptions = true;
            this.gbList.OptionsLayout.StoreAppearance = true;
            this.gbList.OptionsMenu.EnableColumnMenu = false;
            this.gbList.OptionsMenu.EnableGroupPanelMenu = false;
            this.gbList.OptionsNavigation.EnterMoveNextColumn = true;
            this.gbList.OptionsSelection.InvertSelection = true;
            this.gbList.OptionsSelection.MultiSelect = true;
            this.gbList.OptionsView.AllowCellMerge = true;
            this.gbList.OptionsView.ColumnAutoWidth = false;
            this.gbList.OptionsView.ShowAutoFilterRow = true;
            this.gbList.OptionsView.ShowFilterPanelMode = ShowFilterPanelMode.Never;
            this.gbList.FocusedRowChanged += new FocusedRowChangedEventHandler(this.gbList_FocusedRowChanged);
            this.gbList.CustomDrawRowIndicator += new RowIndicatorCustomDrawEventHandler(this.gbList_CustomDrawRowIndicator);
            this.gbList.KeyDown += new KeyEventHandler(this.gbList_KeyDown);
            this.gbList.MouseDown += new MouseEventHandler(this.gbList_MouseDown);
            this.gbList.DoubleClick += new EventHandler(this.gbList_DoubleClick);
            this.gbList.RowCellClick += new RowCellClickEventHandler(this.gbList_RowCellClick);
            this.gridBand2.AppearanceHeader.Options.UseTextOptions = true;
            this.gridBand2.AppearanceHeader.TextOptions.HAlignment = HorzAlignment.Center;
            this.gridBand2.Caption = "Th\x00f4ng tin nh\x00e2n vi\x00ean";
            this.gridBand2.Columns.Add(this.colEmployeeCode);
            this.gridBand2.Columns.Add(this.colFirstName);
            this.gridBand2.Columns.Add(this.colLastName);
            this.gridBand2.Columns.Add(this.colBranchName);
            this.gridBand2.Columns.Add(this.colDepartmentName);
            this.gridBand2.Columns.Add(this.colGroupName);
            this.gridBand2.Fixed = FixedStyle.Left;
            this.gridBand2.MinWidth = 20;
            this.gridBand2.Name = "gridBand2";
            this.gridBand2.Width = 270;
            this.colEmployeeCode.AppearanceHeader.Font = new Font("Tahoma", 8.25f, FontStyle.Bold);
            this.colEmployeeCode.AppearanceHeader.Options.UseFont = true;
            this.colEmployeeCode.Caption = "M\x00e3 nh\x00e2n vi\x00ean";
            this.colEmployeeCode.FieldName = "EmployeeCode";
            this.colEmployeeCode.Name = "colEmployeeCode";
            this.colEmployeeCode.OptionsColumn.AllowEdit = false;
            this.colEmployeeCode.OptionsColumn.AllowMerge = DefaultBoolean.False;
            this.colEmployeeCode.OptionsColumn.ReadOnly = true;
            this.colEmployeeCode.Visible = true;
            this.colFirstName.AppearanceHeader.Font = new Font("Tahoma", 8.25f, FontStyle.Bold);
            this.colFirstName.AppearanceHeader.Options.UseFont = true;
            this.colFirstName.Caption = "Họ l\x00f3t";
            this.colFirstName.FieldName = "FirstName";
            this.colFirstName.Name = "colFirstName";
            this.colFirstName.OptionsColumn.AllowEdit = false;
            this.colFirstName.OptionsColumn.AllowMerge = DefaultBoolean.False;
            this.colFirstName.OptionsColumn.ReadOnly = true;
            this.colFirstName.Visible = true;
            this.colFirstName.Width = 0x7c;
            this.colLastName.AppearanceHeader.Font = new Font("Tahoma", 8.25f, FontStyle.Bold);
            this.colLastName.AppearanceHeader.Options.UseFont = true;
            this.colLastName.Caption = "T\x00ean";
            this.colLastName.FieldName = "LastName";
            this.colLastName.Name = "colLastName";
            this.colLastName.OptionsColumn.AllowEdit = false;
            this.colLastName.OptionsColumn.AllowMerge = DefaultBoolean.False;
            this.colLastName.OptionsColumn.ReadOnly = true;
            this.colLastName.Visible = true;
            this.colLastName.Width = 0x47;
            this.colBranchName.Caption = "Chi nh\x00e1nh";
            this.colBranchName.FieldName = "BranchName";
            this.colBranchName.Name = "colBranchName";
            this.colBranchName.OptionsColumn.AllowEdit = false;
            this.colBranchName.OptionsColumn.AllowMerge = DefaultBoolean.False;
            this.colBranchName.OptionsColumn.ReadOnly = true;
            this.colDepartmentName.Caption = "Ph\x00f2ng ban";
            this.colDepartmentName.FieldName = "DepartmentName";
            this.colDepartmentName.Name = "colDepartmentName";
            this.colDepartmentName.OptionsColumn.AllowEdit = false;
            this.colDepartmentName.OptionsColumn.AllowMerge = DefaultBoolean.False;
            this.colDepartmentName.OptionsColumn.ReadOnly = true;
            this.colGroupName.Caption = "Tổ nh\x00f3m";
            this.colGroupName.FieldName = "GroupName";
            this.colGroupName.Name = "colGroupName";
            this.colGroupName.OptionsColumn.AllowEdit = false;
            this.colGroupName.OptionsColumn.AllowMerge = DefaultBoolean.False;
            this.colGroupName.OptionsColumn.ReadOnly = true;
            this.gridBand9.Columns.Add(this.colWriteDate);
            this.gridBand9.MinWidth = 20;
            this.gridBand9.Name = "gridBand9";
            this.gridBand9.Width = 110;
            this.colWriteDate.AppearanceCell.BackColor = Color.WhiteSmoke;
            this.colWriteDate.AppearanceCell.Options.UseBackColor = true;
            this.colWriteDate.AppearanceCell.Options.UseTextOptions = true;
            this.colWriteDate.AppearanceCell.TextOptions.HAlignment = HorzAlignment.Center;
            this.colWriteDate.AppearanceHeader.Font = new Font("Tahoma", 8.25f, FontStyle.Bold);
            this.colWriteDate.AppearanceHeader.ForeColor = Color.Red;
            this.colWriteDate.AppearanceHeader.Options.UseFont = true;
            this.colWriteDate.AppearanceHeader.Options.UseForeColor = true;
            this.colWriteDate.Caption = "Ng\x00e0y viết đơn";
            this.colWriteDate.FieldName = "WriteDate";
            this.colWriteDate.Name = "colWriteDate";
            this.colWriteDate.OptionsColumn.AllowEdit = false;
            this.colWriteDate.OptionsColumn.AllowMerge = DefaultBoolean.False;
            this.colWriteDate.OptionsColumn.ReadOnly = true;
            this.colWriteDate.Visible = true;
            this.colWriteDate.Width = 110;
            this.gridBand3.AppearanceHeader.ForeColor = Color.DarkOliveGreen;
            this.gridBand3.AppearanceHeader.Options.UseForeColor = true;
            this.gridBand3.AppearanceHeader.Options.UseTextOptions = true;
            this.gridBand3.AppearanceHeader.TextOptions.HAlignment = HorzAlignment.Center;
            this.gridBand3.Caption = "Ng\x00e0y xin nghỉ";
            this.gridBand3.Columns.Add(this.colWriteFromDate);
            this.gridBand3.Columns.Add(this.colWriteToDate);
            this.gridBand3.MinWidth = 20;
            this.gridBand3.Name = "gridBand3";
            this.gridBand3.Width = 0xbc;
            this.colWriteFromDate.AppearanceCell.BackColor = Color.MintCream;
            this.colWriteFromDate.AppearanceCell.Options.UseBackColor = true;
            this.colWriteFromDate.AppearanceCell.Options.UseTextOptions = true;
            this.colWriteFromDate.AppearanceCell.TextOptions.HAlignment = HorzAlignment.Center;
            this.colWriteFromDate.AppearanceHeader.ForeColor = Color.DarkOliveGreen;
            this.colWriteFromDate.AppearanceHeader.Options.UseForeColor = true;
            this.colWriteFromDate.Caption = "Ng\x00e0y nghỉ từ";
            this.colWriteFromDate.FieldName = "WriteFromDate";
            this.colWriteFromDate.Name = "colWriteFromDate";
            this.colWriteFromDate.OptionsColumn.AllowEdit = false;
            this.colWriteFromDate.OptionsColumn.AllowMerge = DefaultBoolean.False;
            this.colWriteFromDate.OptionsColumn.ReadOnly = true;
            this.colWriteFromDate.Visible = true;
            this.colWriteFromDate.Width = 0x5d;
            this.colWriteToDate.AppearanceCell.BackColor = Color.MintCream;
            this.colWriteToDate.AppearanceCell.Options.UseBackColor = true;
            this.colWriteToDate.AppearanceCell.Options.UseTextOptions = true;
            this.colWriteToDate.AppearanceCell.TextOptions.HAlignment = HorzAlignment.Center;
            this.colWriteToDate.AppearanceHeader.ForeColor = Color.DarkOliveGreen;
            this.colWriteToDate.AppearanceHeader.Options.UseForeColor = true;
            this.colWriteToDate.Caption = "Ng\x00e0y nghỉ đến";
            this.colWriteToDate.FieldName = "WriteToDate";
            this.colWriteToDate.Name = "colWriteToDate";
            this.colWriteToDate.OptionsColumn.AllowEdit = false;
            this.colWriteToDate.OptionsColumn.AllowMerge = DefaultBoolean.False;
            this.colWriteToDate.OptionsColumn.ReadOnly = true;
            this.colWriteToDate.Visible = true;
            this.colWriteToDate.Width = 0x5f;
            this.gridBand5.AppearanceHeader.ForeColor = Color.Purple;
            this.gridBand5.AppearanceHeader.Options.UseForeColor = true;
            this.gridBand5.AppearanceHeader.Options.UseTextOptions = true;
            this.gridBand5.AppearanceHeader.TextOptions.HAlignment = HorzAlignment.Center;
            this.gridBand5.Caption = "Ng\x00e0y kh\x00f4ng t\x00ednh c\x00f4ng";
            this.gridBand5.MinWidth = 20;
            this.gridBand5.Name = "gridBand5";
            this.gridBand5.Visible = false;
            this.gridBand5.Width = 0x48;
            this.gridBand8.AppearanceHeader.ForeColor = Color.Green;
            this.gridBand8.AppearanceHeader.Options.UseForeColor = true;
            this.gridBand8.AppearanceHeader.Options.UseTextOptions = true;
            this.gridBand8.AppearanceHeader.TextOptions.HAlignment = HorzAlignment.Center;
            this.gridBand8.Caption = "Thời gian nghỉ thực tế";
            this.gridBand8.Columns.Add(this.colRestFromDate);
            this.gridBand8.Columns.Add(this.colRestToDate);
            this.gridBand8.MinWidth = 20;
            this.gridBand8.Name = "gridBand8";
            this.gridBand8.Width = 0xd7;
            this.colRestFromDate.AppearanceCell.BackColor = Color.MintCream;
            this.colRestFromDate.AppearanceCell.Options.UseBackColor = true;
            this.colRestFromDate.AppearanceCell.Options.UseTextOptions = true;
            this.colRestFromDate.AppearanceCell.TextOptions.HAlignment = HorzAlignment.Center;
            this.colRestFromDate.AppearanceHeader.ForeColor = Color.DarkOliveGreen;
            this.colRestFromDate.AppearanceHeader.Options.UseForeColor = true;
            this.colRestFromDate.Caption = "Thời gian nghỉ từ";
            this.colRestFromDate.FieldName = "RestFromDate";
            this.colRestFromDate.Name = "colRestFromDate";
            this.colRestFromDate.OptionsColumn.AllowEdit = false;
            this.colRestFromDate.OptionsColumn.AllowMerge = DefaultBoolean.False;
            this.colRestFromDate.OptionsColumn.ReadOnly = true;
            this.colRestFromDate.Visible = true;
            this.colRestFromDate.Width = 0x67;
            this.colRestToDate.AppearanceCell.BackColor = Color.MintCream;
            this.colRestToDate.AppearanceCell.Options.UseBackColor = true;
            this.colRestToDate.AppearanceCell.Options.UseTextOptions = true;
            this.colRestToDate.AppearanceCell.TextOptions.HAlignment = HorzAlignment.Center;
            this.colRestToDate.AppearanceHeader.ForeColor = Color.DarkOliveGreen;
            this.colRestToDate.AppearanceHeader.Options.UseForeColor = true;
            this.colRestToDate.Caption = "Thời gian nghỉ đến";
            this.colRestToDate.FieldName = "RestToDate";
            this.colRestToDate.Name = "colRestToDate";
            this.colRestToDate.OptionsColumn.AllowEdit = false;
            this.colRestToDate.OptionsColumn.AllowMerge = DefaultBoolean.False;
            this.colRestToDate.OptionsColumn.ReadOnly = true;
            this.colRestToDate.Visible = true;
            this.colRestToDate.Width = 0x70;
            this.gridBand7.AppearanceHeader.ForeColor = Color.Purple;
            this.gridBand7.AppearanceHeader.Options.UseForeColor = true;
            this.gridBand7.AppearanceHeader.Options.UseTextOptions = true;
            this.gridBand7.AppearanceHeader.TextOptions.HAlignment = HorzAlignment.Center;
            this.gridBand7.Caption = "K\x00fd hiệu/L\x00fd do nghỉ";
            this.gridBand7.Columns.Add(this.colSymbol);
            this.gridBand7.Columns.Add(this.colReason);
            this.gridBand7.MinWidth = 20;
            this.gridBand7.Name = "gridBand7";
            this.gridBand7.Width = 0xe1;
            this.colSymbol.AppearanceCell.BackColor = Color.GhostWhite;
            this.colSymbol.AppearanceCell.Options.UseBackColor = true;
            this.colSymbol.AppearanceCell.Options.UseTextOptions = true;
            this.colSymbol.AppearanceCell.TextOptions.HAlignment = HorzAlignment.Center;
            this.colSymbol.AppearanceHeader.ForeColor = Color.Purple;
            this.colSymbol.AppearanceHeader.Options.UseForeColor = true;
            this.colSymbol.Caption = "K\x00fd hiệu";
            this.colSymbol.FieldName = "Symbol";
            this.colSymbol.Name = "colSymbol";
            this.colSymbol.OptionsColumn.AllowEdit = false;
            this.colSymbol.OptionsColumn.AllowMerge = DefaultBoolean.False;
            this.colSymbol.Visible = true;
            this.colSymbol.Width = 0x44;
            this.colReason.AppearanceCell.BackColor = Color.GhostWhite;
            this.colReason.AppearanceCell.Options.UseBackColor = true;
            this.colReason.AppearanceHeader.ForeColor = Color.Purple;
            this.colReason.AppearanceHeader.Options.UseForeColor = true;
            this.colReason.Caption = "L\x00fd do nghỉ";
            this.colReason.FieldName = "Reason";
            this.colReason.Name = "colReason";
            this.colReason.OptionsColumn.AllowEdit = false;
            this.colReason.OptionsColumn.AllowMerge = DefaultBoolean.False;
            this.colReason.Visible = true;
            this.colReason.Width = 0x9d;
            this.gridBand1.AppearanceHeader.Options.UseTextOptions = true;
            this.gridBand1.AppearanceHeader.TextOptions.HAlignment = HorzAlignment.Center;
            this.gridBand1.Columns.Add(this.colStatus);
            this.gridBand1.Columns.Add(this.colReasonCannot);
            this.gridBand1.Columns.Add(this.colDescription);
            this.gridBand1.MinWidth = 20;
            this.gridBand1.Name = "gridBand1";
            this.gridBand1.Width = 0x1ec;
            this.colReasonCannot.Caption = "L\x00fd do kh\x00f4ng được duyệt";
            this.colReasonCannot.FieldName = "ReasonCannot";
            this.colReasonCannot.Name = "colReasonCannot";
            this.colReasonCannot.OptionsColumn.AllowEdit = false;
            this.colReasonCannot.OptionsColumn.AllowMerge = DefaultBoolean.False;
            this.colReasonCannot.Visible = true;
            this.colReasonCannot.Width = 0x7a;
            this.colDescription.Caption = "Ghi ch\x00fa";
            this.colDescription.FieldName = "Description";
            this.colDescription.Name = "colDescription";
            this.colDescription.OptionsColumn.AllowEdit = false;
            this.colDescription.OptionsColumn.AllowMerge = DefaultBoolean.False;
            this.colDescription.OptionsColumn.ReadOnly = true;
            this.colDescription.Visible = true;
            this.colDescription.Width = 0x114;
            this.colPetitionID.Caption = "M\x00e3";
            this.colPetitionID.FieldName = "PetitionID";
            this.colPetitionID.Name = "colPetitionID";
            this.repCal.AutoHeight = false;
            this.repCal.Buttons.AddRange(new EditorButton[] { new EditorButton(ButtonPredefines.Combo) });
            this.repCal.Name = "repCal";
            base.AutoScaleDimensions = new SizeF(6f, 13f);
            base.AutoScaleMode = AutoScaleMode.Font;
            base.Controls.Add(this.gcList);
            base.Controls.Add(this.barDockControlLeft);
            base.Controls.Add(this.barDockControlRight);
            base.Controls.Add(this.barDockControlBottom);
            base.Controls.Add(this.barDockControlTop);
            base.Name = "xucListPetition";
            base.Size = new Size(0x4ab, 0x26f);
            this.repStatus.EndInit();
            this.rptPhoto.EndInit();
            this.barManager1.EndInit();
            this.repositoryItemImageComboBox1.EndInit();
            this.repBeginDate.VistaTimeProperties.EndInit();
            this.repBeginDate.EndInit();
            this.repEndDate.VistaTimeProperties.EndInit();
            this.repEndDate.EndInit();
            this.imageCollection2.EndInit();
            this.repMonth.EndInit();
            this.repYear.EndInit();
            this.imgList.EndInit();
            this.gcList.EndInit();
            this.gbList.EndInit();
            this.repCal.EndInit();
            base.ResumeLayout(false);
        }

        private void LoadGrid()
        {
            HRM_PROCESS_PETITION hrm_process_petition = new HRM_PROCESS_PETITION();
            if (this.m_IndexKey == 0)
            {
                this.gcList.DataSource = hrm_process_petition.GetAllList();
            }
            else
            {
                this.gcList.DataSource = hrm_process_petition.GetAllListByDays(System.DateTime.Parse(this.bbeBeginDate.EditValue.ToString()), System.DateTime.Parse(this.bbeEndDate.EditValue.ToString()));
            }
        }

        private void RaiseClosedHander()
        {
            if (this.Closed != null)
            {
                this.Closed(this);
            }
        }

        private void ReLoad()
        {
            base.SetWaitDialogCaption("Đang nạp dữ liệu...");
            this.bbiFilter.EditValue = this.m_IndexKey;
            this.bbiFilter.EditValueChanged += new EventHandler(this.bbiFilter_EditValueChanged);
            this.bbeBeginDate.EditValueChanged += (s, e) => this.LoadGrid();
            this.bbeEndDate.EditValueChanged += (s, e) => this.LoadGrid();
            this.LoadGrid();
        }

        private void SetMenu(Common.Class.RowClickEventArgs e)
        {
            object rowCellValue = this.gbList.GetRowCellValue(this.gbList.FocusedRowHandle, "PetitionID");
            this.DisableMenu(false);
            if (rowCellValue == null)
            {
                this.DisableMenu(true);
            }
        }

        private void ucList_ListKeyDown(object sender, KeyEventArgs key)
        {
            if (key.KeyCode == Keys.F2)
            {
                if (this.gbList.RowCount != 0)
                {
                    this.Change();
                }
            }
            else if ((key.KeyCode == Keys.Control) | (key.KeyCode == Keys.E))
            {
                if (this.gbList.RowCount != 0)
                {
                    this.Change();
                }
            }
            else if (key.KeyCode == Keys.Enter)
            {
                if (this.gbList.RowCount != 0)
                {
                    this.Change();
                }
            }
            else if (key.KeyCode == Keys.F5)
            {
                this.ReLoad();
            }
            else if ((key.KeyCode == Keys.Control) | (key.KeyCode == Keys.N))
            {
                this.Add();
            }
            else if ((key.KeyCode == Keys.Control) | (key.KeyCode == Keys.T))
            {
                this.Add();
            }
        }

        private void UpdateRow(HRM_PROCESS_PETITION item)
        {
            BandedGridView gbList = this.gbList;
            int focusedRowHandle = this.gbList.FocusedRowHandle;
            gbList.SetRowCellValue(focusedRowHandle, "PetitionID", item.PetitionID);
            gbList.SetRowCellValue(focusedRowHandle, "EmployeeCode", item.EmployeeCode);
            HRM_EMPLOYEE hrm_employee = new HRM_EMPLOYEE();
            hrm_employee.Get(item.EmployeeCode);
            gbList.SetRowCellValue(focusedRowHandle, "FirstName", hrm_employee.FirstName);
            gbList.SetRowCellValue(focusedRowHandle, "LastName", hrm_employee.LastName);
            gbList.SetRowCellValue(focusedRowHandle, "WriteDate", item.WriteDate);
            gbList.SetRowCellValue(focusedRowHandle, "WriteFromDate", item.WriteFromDate);
            gbList.SetRowCellValue(focusedRowHandle, "WriteToDate", item.WriteToDate);
            gbList.SetRowCellValue(focusedRowHandle, "RestFromDate", item.RestFromDate);
            gbList.SetRowCellValue(focusedRowHandle, "RestToDate", item.RestToDate);
            gbList.SetRowCellValue(focusedRowHandle, "Symbol", item.Symbol);
            gbList.SetRowCellValue(focusedRowHandle, "Reason", item.Reason);
            gbList.SetRowCellValue(focusedRowHandle, "Status", item.Status);
            gbList.SetRowCellValue(focusedRowHandle, "ReasonCannot", item.ReasonCannot);
            gbList.SetRowCellValue(focusedRowHandle, "Description", item.Description);
            gbList.UpdateCurrentRow();
        }

        public delegate void ClosedHander(object sender);
    }
}

